package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.City;
import com.ruoyi.system.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 城市信息
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/system/region")
public class CityController extends BaseController
{
    @Autowired
    private ICityService cityService;

    /**
     * 获取城市下拉树列表
     */
    @GetMapping("/tree")
    public AjaxResult treeselect()
    {
        List<City> cities = cityService.selectCityTree();
        return AjaxResult.success(cities);
    }
} 